/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'agency.aliyuncs.com',
    ap-northeast-2-pop = 'agency.aliyuncs.com',
    ap-south-1 = 'agency.aliyuncs.com',
    ap-southeast-2 = 'agency.aliyuncs.com',
    ap-southeast-3 = 'agency.aliyuncs.com',
    ap-southeast-5 = 'agency.aliyuncs.com',
    cn-beijing = 'agency.aliyuncs.com',
    cn-beijing-finance-1 = 'agency.aliyuncs.com',
    cn-beijing-finance-pop = 'agency.aliyuncs.com',
    cn-beijing-gov-1 = 'agency.aliyuncs.com',
    cn-beijing-nu16-b01 = 'agency.aliyuncs.com',
    cn-chengdu = 'agency.aliyuncs.com',
    cn-edge-1 = 'agency.aliyuncs.com',
    cn-fujian = 'agency.aliyuncs.com',
    cn-haidian-cm12-c01 = 'agency.aliyuncs.com',
    cn-hangzhou = 'agency.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'agency.aliyuncs.com',
    cn-hangzhou-finance = 'agency.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'agency.aliyuncs.com',
    cn-hangzhou-test-306 = 'agency.aliyuncs.com',
    cn-hongkong = 'agency.aliyuncs.com',
    cn-hongkong-finance-pop = 'agency.aliyuncs.com',
    cn-huhehaote = 'agency.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'agency.aliyuncs.com',
    cn-north-2-gov-1 = 'agency.aliyuncs.com',
    cn-qingdao = 'agency.aliyuncs.com',
    cn-qingdao-nebula = 'agency.aliyuncs.com',
    cn-shanghai = 'agency.aliyuncs.com',
    cn-shanghai-et15-b01 = 'agency.aliyuncs.com',
    cn-shanghai-et2-b01 = 'agency.aliyuncs.com',
    cn-shanghai-finance-1 = 'agency.aliyuncs.com',
    cn-shanghai-inner = 'agency.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'agency.aliyuncs.com',
    cn-shenzhen = 'agency.aliyuncs.com',
    cn-shenzhen-finance-1 = 'agency.aliyuncs.com',
    cn-shenzhen-inner = 'agency.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'agency.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'agency.aliyuncs.com',
    cn-wuhan = 'agency.aliyuncs.com',
    cn-wulanchabu = 'agency.aliyuncs.com',
    cn-yushanfang = 'agency.aliyuncs.com',
    cn-zhangbei = 'agency.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'agency.aliyuncs.com',
    cn-zhangjiakou = 'agency.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'agency.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'agency.aliyuncs.com',
    eu-central-1 = 'agency.aliyuncs.com',
    eu-west-1 = 'agency.aliyuncs.com',
    eu-west-1-oxs = 'agency.aliyuncs.com',
    me-east-1 = 'agency.aliyuncs.com',
    rus-west-1-pop = 'agency.aliyuncs.com',
    us-east-1 = 'agency.aliyuncs.com',
    us-west-1 = 'agency.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('agency', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DeductOutstandingBalanceRequest {
  deductAmount?: string(name='DeductAmount'),
  uid?: long(name='Uid'),
}

model DeductOutstandingBalanceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model DeductOutstandingBalanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeductOutstandingBalanceResponseBody(name='body'),
}

async function deductOutstandingBalanceWithOptions(request: DeductOutstandingBalanceRequest, runtime: Util.RuntimeOptions): DeductOutstandingBalanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deductAmount)) {
    query['DeductAmount'] = request.deductAmount;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeductOutstandingBalance',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deductOutstandingBalance(request: DeductOutstandingBalanceRequest): DeductOutstandingBalanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deductOutstandingBalanceWithOptions(request, runtime);
}

model GetAccountInfoRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  uid?: long(name='Uid'),
  userType?: string(name='UserType'),
}

model GetAccountInfoResponseBody = {
  accountInfoList?: {
    accountInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      aliyunId?: string(name='AliyunId'),
      associationSuccessTime?: string(name='AssociationSuccessTime'),
      email?: string(name='Email'),
      mobile?: string(name='Mobile'),
      remark?: string(name='Remark'),
      subAccountType?: int32(name='SubAccountType'),
      uid?: long(name='Uid'),
    }
  ](name='AccountInfo')
  }(name='AccountInfoList'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetAccountInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAccountInfoResponseBody(name='body'),
}

async function getAccountInfoWithOptions(request: GetAccountInfoRequest, runtime: Util.RuntimeOptions): GetAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.userType)) {
    query['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccountInfo',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAccountInfo(request: GetAccountInfoRequest): GetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccountInfoWithOptions(request, runtime);
}

model GetCreditInfoRequest {
  uid?: long(name='Uid'),
}

model GetCreditInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountStatus?: string(name='AccountStatus'),
    alarmThreshold?: string(name='AlarmThreshold'),
    availableCredit?: string(name='AvailableCredit'),
    creditLine?: string(name='CreditLine'),
    outstandingBalance?: string(name='OutstandingBalance'),
    zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetCreditInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCreditInfoResponseBody(name='body'),
}

async function getCreditInfoWithOptions(request: GetCreditInfoRequest, runtime: Util.RuntimeOptions): GetCreditInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreditInfo',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCreditInfo(request: GetCreditInfoRequest): GetCreditInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreditInfoWithOptions(request, runtime);
}

model GetDailyBillRequest {
  billOwner?: string(name='BillOwner', example='1'),
  billType?: string(name='BillType', example='DailyInstanceBill'),
  date?: string(name='Date', example='2022-11-24'),
}

model GetDailyBillResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billLinkXLSX?: string(name='BillLinkXLSX', example='intl-reseller-month-bill.oss-ap-southeast-1.aliyuncs.com/statements/month/dts/1064252248461886/202104/Month%20Billing%20Invoice%20202104.pdf?Expires=1671160973&OSSAccessKeyId=TMP.3KhvoD9pW264cPv8sYe8E2zJ5HLWmrijNHgKiKpXcy8yS472BcrvemgTfNrrXKu5fCCdbLr2XhmYAyYPmbCe8zJyEkmYzL&Signature=hns1PgiiYl1WdI%2FdiOqbEdsgmfI%3D'),
    billOwner?: string(name='BillOwner', example='1'),
    billType?: string(name='BillType', example='DailyInstanceBill'),
    spendingTime?: string(name='SpendingTime', example='20221201'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success', example='true'),
}

model GetDailyBillResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDailyBillResponseBody(name='body'),
}

async function getDailyBillWithOptions(request: GetDailyBillRequest, runtime: Util.RuntimeOptions): GetDailyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.date)) {
    query['Date'] = request.date;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDailyBill',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDailyBill(request: GetDailyBillRequest): GetDailyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDailyBillWithOptions(request, runtime);
}

model GetInviteStatusRequest {
  inviteStatusList?: [ 
    {
      inviteId?: long(name='InviteId'),
    }
  ](name='InviteStatusList'),
}

model GetInviteStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    inviteStatus?: [ 
    {
      code?: string(name='Code'),
      inviteStatusList?: {
        aliyunId?: string(name='AliyunId'),
        associationSuccessTime?: string(name='AssociationSuccessTime'),
        gmtCreate?: string(name='GmtCreate'),
        parentId?: string(name='ParentId'),
        status?: int32(name='Status'),
        subAccountType?: string(name='SubAccountType'),
      }(name='InviteStatusList'),
      message?: string(name='Message'),
      success?: boolean(name='Success'),
    }
  ](name='InviteStatus')
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetInviteStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInviteStatusResponseBody(name='body'),
}

async function getInviteStatusWithOptions(request: GetInviteStatusRequest, runtime: Util.RuntimeOptions): GetInviteStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteStatusList)) {
    query['InviteStatusList'] = request.inviteStatusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInviteStatus',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInviteStatus(request: GetInviteStatusRequest): GetInviteStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInviteStatusWithOptions(request, runtime);
}

model GetMonthlyBillRequest {
  billOwner?: string(name='BillOwner'),
  billType?: string(name='BillType'),
  month?: string(name='Month'),
}

model GetMonthlyBillResponseBody = {
  code?: string(name='Code'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV'),
    billLinkXLSX?: string(name='BillLinkXLSX'),
    billOwner?: string(name='BillOwner'),
    billType?: string(name='BillType'),
    invoiceLink?: string(name='InvoiceLink'),
    refundInvoiceFlag?: boolean(name='RefundInvoiceFlag'),
    refundInvoiceLink?: string(name='RefundInvoiceLink'),
    spendingTime?: string(name='SpendingTime'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetMonthlyBillResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMonthlyBillResponseBody(name='body'),
}

async function getMonthlyBillWithOptions(request: GetMonthlyBillRequest, runtime: Util.RuntimeOptions): GetMonthlyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.month)) {
    query['Month'] = request.month;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMonthlyBill',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMonthlyBill(request: GetMonthlyBillRequest): GetMonthlyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMonthlyBillWithOptions(request, runtime);
}

model GetUnassociatedCustomerRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
}

model GetUnassociatedCustomerResponseBody = {
  code?: string(name='Code'),
  inviteInfoList?: {
    inviteInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      email?: string(name='Email'),
      gmtCreate?: string(name='GmtCreate'),
      inviteId?: long(name='InviteId'),
      status?: int32(name='Status'),
    }
  ](name='InviteInfo')
  }(name='InviteInfoList'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetUnassociatedCustomerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUnassociatedCustomerResponseBody(name='body'),
}

async function getUnassociatedCustomerWithOptions(request: GetUnassociatedCustomerRequest, runtime: Util.RuntimeOptions): GetUnassociatedCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUnassociatedCustomer',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUnassociatedCustomer(request: GetUnassociatedCustomerRequest): GetUnassociatedCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUnassociatedCustomerWithOptions(request, runtime);
}

model InviteSubAccountRequest {
  accountInfoList?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      creditLine?: string(name='CreditLine'),
      customerId?: string(name='CustomerId'),
      emailAddress?: string(name='EmailAddress'),
      remark?: string(name='Remark'),
      subAccountType?: string(name='SubAccountType'),
      zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy'),
    }
  ](name='AccountInfoList'),
}

model InviteSubAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  results?: {
    result?: [ 
    {
      code?: string(name='Code'),
      message?: string(name='Message'),
      result?: {
        days?: int32(name='Days'),
        inviteId?: long(name='InviteId'),
        regUrl?: string(name='RegUrl'),
      }(name='Result'),
      success?: boolean(name='Success'),
    }
  ](name='Result')
  }(name='Results'),
  success?: boolean(name='Success'),
}

model InviteSubAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: InviteSubAccountResponseBody(name='body'),
}

async function inviteSubAccountWithOptions(request: InviteSubAccountRequest, runtime: Util.RuntimeOptions): InviteSubAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountInfoList)) {
    query['AccountInfoList'] = request.accountInfoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InviteSubAccount',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function inviteSubAccount(request: InviteSubAccountRequest): InviteSubAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return inviteSubAccountWithOptions(request, runtime);
}

model ResendEmailRequest {
  inviteId?: long(name='InviteId'),
}

model ResendEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ResendEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendEmailResponseBody(name='body'),
}

async function resendEmailWithOptions(request: ResendEmailRequest, runtime: Util.RuntimeOptions): ResendEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteId)) {
    query['InviteId'] = request.inviteId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResendEmail',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendEmail(request: ResendEmailRequest): ResendEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendEmailWithOptions(request, runtime);
}

model SetAccountInfoRequest {
  accountNickname?: string(name='AccountNickname'),
  remark?: string(name='Remark'),
  uid?: long(name='Uid'),
}

model SetAccountInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetAccountInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAccountInfoResponseBody(name='body'),
}

async function setAccountInfoWithOptions(request: SetAccountInfoRequest, runtime: Util.RuntimeOptions): SetAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNickname)) {
    query['AccountNickname'] = request.accountNickname;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccountInfo',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAccountInfo(request: SetAccountInfoRequest): SetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccountInfoWithOptions(request, runtime);
}

model SetCreditLineRequest {
  creditLine?: string(name='CreditLine'),
  uid?: long(name='Uid'),
}

model SetCreditLineResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditLineResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditLineResponseBody(name='body'),
}

async function setCreditLineWithOptions(request: SetCreditLineRequest, runtime: Util.RuntimeOptions): SetCreditLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditLine)) {
    query['CreditLine'] = request.creditLine;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditLine',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditLine(request: SetCreditLineRequest): SetCreditLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditLineWithOptions(request, runtime);
}

model SetCreditStatusRequest {
  creditStatus?: long(name='CreditStatus'),
  uid?: long(name='Uid'),
}

model SetCreditStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditStatusResponseBody(name='body'),
}

async function setCreditStatusWithOptions(request: SetCreditStatusRequest, runtime: Util.RuntimeOptions): SetCreditStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditStatus)) {
    query['CreditStatus'] = request.creditStatus;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditStatus',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditStatus(request: SetCreditStatusRequest): SetCreditStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditStatusWithOptions(request, runtime);
}

model SetWarningThresholdRequest {
  uid?: long(name='Uid'),
  warningValue?: string(name='WarningValue'),
}

model SetWarningThresholdResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetWarningThresholdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetWarningThresholdResponseBody(name='body'),
}

async function setWarningThresholdWithOptions(request: SetWarningThresholdRequest, runtime: Util.RuntimeOptions): SetWarningThresholdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.warningValue)) {
    query['WarningValue'] = request.warningValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetWarningThreshold',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setWarningThreshold(request: SetWarningThresholdRequest): SetWarningThresholdResponse {
  var runtime = new Util.RuntimeOptions{};
  return setWarningThresholdWithOptions(request, runtime);
}

model SetZeroCreditShutdownPolicyRequest {
  shutdownPolicy?: string(name='ShutdownPolicy'),
  uid?: long(name='Uid'),
}

model SetZeroCreditShutdownPolicyResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetZeroCreditShutdownPolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetZeroCreditShutdownPolicyResponseBody(name='body'),
}

async function setZeroCreditShutdownPolicyWithOptions(request: SetZeroCreditShutdownPolicyRequest, runtime: Util.RuntimeOptions): SetZeroCreditShutdownPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.shutdownPolicy)) {
    query['ShutdownPolicy'] = request.shutdownPolicy;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetZeroCreditShutdownPolicy',
    version = '2018-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setZeroCreditShutdownPolicy(request: SetZeroCreditShutdownPolicyRequest): SetZeroCreditShutdownPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return setZeroCreditShutdownPolicyWithOptions(request, runtime);
}

